#pragma once
#include "shape.h"
#include <vector>
#include <fstream>
#include <iostream>
#include <string>
#include <sstream>
using namespace std;
struct TRIPLE {
	int index[3];
	TRIPLE() {index[0]=-1;index[1]=-1; index[2]=-1;}
};

class MMesh : public Shape
{
private:
	vector<MVertex> vertex, texture, normal;
	vector<vector<TRIPLE>> poly;
private:
	MMesh(void);
	bool extractDataFromFile();
public:
	~MMesh(void);
	static MMesh *makeMesh(string strFile);
	void drawShape();
	void drawMesh(void(*draw_poly)(const vector<MVertex> &v1, int ic),
		void(*drawline)(const MVertex &p1,  const MVertex &p2,int ic)=NULL);
	void incrementSlice();
	void decrementSlice();
	void incrementStack();
	void decrementStack();
};

